import socket


class InetAddress:
    @classmethod
    def get_local_host(cls="0.0.0.0"):
        s = None
        try:
            s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
            s.connect(('8.8.8.8', 80))
            ip = s.getsockname()[0]
            return ip
        except Exception as e:
            print(f"Error getting local IP: {e}")
            return cls
        finally:
            if s:
                s.close()
